import React, { Component } from 'react'

class Header extends Component {
    constructor(props) {
        super(props)
        this.state = {
            content: ''
        }
    }

    handleInput = (e) => {
        console.log(e.target.value);
        this.setState({
            content: e.target.value
        })
    }

    render() {
        return (
            <div>
                <input type="text" value={this.state.content} onChange={this.handleInput}/>
                <button onClick={() => this.props.handleSubmit(this.state.content)}>提交</button>
            </div>
        )
    }
}


export default Header

